package com.tracesystem.dao;

import com.tracesystem.model.IssueResource;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author Kevin Martin
 * @since 2022-03-23
 */
@Component
public interface IssueResourceDao extends BaseMapper<IssueResource> {
    @Select("SELECT \n"+
                   "iir.RESOURCE_URI\n"+
                   "FROM i_issue_resource iir\n"+
                   "JOIN i_issue_role_resource iirr\n"+
                   "on iir.RESOURCE_ID=iirr.RESOURCE_ID\n"+
            "WHERE iirr.ROLE_ID =#{id}")
    List<String> getResourceUriList(@Param("id") Integer id);
}
